builder-tool: Handle layout properties gracefully
authorMatthias Clasen <mclasen@redhat.com>
Sat, 6 Apr 2019 00:48:24 +0000 (00:48 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 6 Apr 2019 00:52:29 +0000 (20:52 -0400)
If there are already layout properties in the ui
file, we shouldn't crash, even if --3to4 is given.

gtk/tools/gtk-builder-tool-simplify.c

index cd15fd504cc94437422dddc9efcf6b8d56023491..7d64b2aa41168ee5d316986d8c7335848e17a44a 100644 (file)
@@ -438,6 +438,9 @@ get_class_name (Element *element)
 
   if (g_str_equal (parent->element_name, "packing"))
     parent = parent->parent->parent; /* child - object */
+  else if (g_str_equal (parent->element_name, "layout"))
+    parent = parent->parent->parent->parent; /* object - child - object */
+
 
   if (g_str_equal (parent->element_name, "object"))
     {